function doSave() {
    var ids=$('#jqGrid').jqGrid('getGridParam','selarrrow');//获得所有被选中的id

    var url = base + "/role/sk/dataRule/insert";
    var roleId = $("#roleId").val();

    $.post(url, {ids:ids.join(), roleId: roleId}, function (data) {
        $.messager.alert0({selector: "#indexAlert", type: data.code, html: data.message});
        if (data && data.code == 'SUCCESS') {
            tools.goto(base + "/role/view/index", 500);
        }
    })
}




function  loadData(){
    var id=$("#roleId").val();
    $("#jqGrid").jqGrid($.extend(jqGrids.defaults,{
        url:base+ '/role/view/dataRule/list?roleId='+id,
        colNames:[ '名称','表达式','编码','描述', '创建时间'],
        colModel: [
            {name:'name',index:'name',width:'70'},
            {name:'expression',index:'expression',width:'70'},
            {name:'code',index:'code',width:'70'},
            {name:'description',index:'description',width:'70'},
            {name:'createTime',index:'createTime',formatter:tools.formatDate,width:'120'}
        ]
    }));
}

/**查询*/
function doSearch(){
    var name=$("input[name=name]").val();
    $("#jqGrid").jqGrid('setGridParam',{
        datatype:'json',
        postData:{'name':name}, //发送数据
        page:0
    }).trigger("reloadGrid"); //重新载入
}
